
/*
    This file is part of the Time-of-Flight Tracer program. It is not part of 
    the original PBRT source distribution. See the included license file for 
    more information.

    Copyright(c) 2014 Microsoft Corporation

    Author: Phil Pitts
 */


#include "stdafx.h"
#include "integrationresult.h"

IntegrationResult::IntegrationResult() : L(0.f) {
}


IntegrationResult::IntegrationResult(const IntegrationResult &other) : L(other.L), 
histogramSamples(other.histogramSamples) {
}


IntegrationResult::IntegrationResult(const Spectrum &L) : L(L) {
}


IntegrationResult::IntegrationResult(const Spectrum &L, 
	const vector<HistogramSample> &histogramSamples) : L(L), 
	histogramSamples(histogramSamples) {
}


IntegrationResult &IntegrationResult::operator+=(const IntegrationResult &rhs) {
	L += rhs.L;

	// Append all rhs histogram samples to the local histogram samples array
	histogramSamples.insert(histogramSamples.end(), rhs.histogramSamples.begin(),
		rhs.histogramSamples.end());

	return *this;
}